<template>
	<el-dialog v-model="model" :title="title" :width="width" >
		<div style="max-height: 70vh;overflow: auto;">
					<slot></slot>
		</div>

		<template #footer v-if="slotShow">
			<div class="dialog-footer">
				<el-button @click="cancel">取消</el-button>
				<el-button type="primary" @click="confirm">
					确认
				</el-button>
			</div>
		</template>

	</el-dialog>

</template>

<script setup>
	import {
		ref
	} from 'vue';

	const props = defineProps({
		title: String,
		width: {
			type: String,
			default: '500'
		},
		slotShow: {
			type: Boolean,
			default: true
		}
	})

	const model = defineModel();
	const emit = defineEmits(['cancel', 'confirm']);

	const cancel = () => {
		model.value = false;
		emit("cancel");
	}

	const confirm = () => {
		emit("confirm");
	}
</script>

<style>
</style>